<template>
	<view class="container-white">
		<view v-if="isRight == 1" class="daily-info-box">
			<image src="../../static/icon/corrent.png" />
			<view>恭喜回答正确，明日再战！</view>
		</view>
		<view v-if="isRight == 2" class="daily-info-box">
			<image src="../../static/icon/mistake.png" />
			<view>很遗憾！回答错误</view>
			<!-- <view v-if='info.rightAnswer == 0 || info.rightAnswer == 1'>正确答案是{{info.rightAnswer == 0?'错':'对'}}</view> -->
			<!-- <view v-else>正确答案是{{info.rightAnswer}}</view> -->
		</view>
		<button class="primary" @click="goAnswer">查看答案</button>
	</view>
</template>

<script>
import { post_md5, request_integral } from '../../common/request';

export default {
	data() {
		return {
			isRight: 2,
			id: null
		};
	},
	onLoad(options) {
		this.dailyAnswerId = options.dailyAnswerId;
		this.id = options.id;
		this.isRight = options.isRight;
		request_integral(`daily_${options.isRight == 1 ? 'ok' : 'err'}`, options.dailyAnswerId);
	},
	methods: {
		goAnswer() {
			uni.redirectTo({
				url: `./daily-answer?id=${this.id}&dailyAnswerId=${this.dailyAnswerId}`
			});
		}
	}
};
</script>

<style>
.daily-info-box {
	margin: 160upx auto;
	text-align: center;
	width: 348px;
	font-size: 30upx;
	font-weight: bold;
	color: #333333;
}

.daily-info-box image {
	width: 164upx;
	height: 164upx;
	border-radius: 50%;
	margin-bottom: 20upx;
}

.container-white button {
	width: 400upx;
	height: 80upx;
	background: rgba(2, 168, 244, 1);
	box-shadow: 0px 6upx 18upx 0px rgba(2, 168, 244, 0.5);
	border-radius: 40upx;
	font-size: 28upx;
	color: #ffffff;
}
</style>
